package com.heima.user.controller;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.LoginDto;
import com.heima.model.user.dtos.LoginResDto;
import com.heima.user.service.ApUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/app/user/api/v1/login")
public class ApUserController {
    @Autowired
    ApUserService apUserService;

    //{"phone":"12011223456","password":"888itcast.CN764%...","equipmentId":"88888888"}
    @PostMapping("/login_auth/")
    public ResponseResult loginAuth(@RequestBody LoginDto loginDto){
        LoginResDto loginResDto=apUserService.loginAuth(loginDto);
        return ResponseResult.okResult(loginResDto);
    }
}
